package cn.stronglink.esm27.collection.iot.devices.algorithmservice.request.handle;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import cn.stronglink.esm27.collection.core.message.IMessageHandle;
import cn.stronglink.esm27.collection.core.util.ContextUtils;
import cn.stronglink.esm27.collection.iot.devices.algorithmservice.message.MQMessageOfESM27;
import cn.stronglink.esm27.collection.iot.devices.esm27.request.handle.CallHandle;
import cn.stronglink.esm27.collection.mq.TopicSender;
import io.netty.channel.ChannelHandlerContext;

public class PullSensorInfoHandle implements IMessageHandle<MQMessageOfESM27, Object> {
	protected static Logger logger = LogManager.getLogger(CallHandle.class.getName());
	protected TopicSender topicSender = (TopicSender) ContextUtils.getBean("topicSender");
	protected final static String TOPIC_NAME="ESM27ToService";		// MQ发送主题
	private final static String ACTION_CODE="GetDeviceRealtimeDataReturn";
	
	@Override
	public boolean isHandle(MQMessageOfESM27 t) {
		if (t.getActioncode().equals(ACTION_CODE)) {
			return true;
		} else {
			return false;
		}
	}
	
	@Override
	public Object handle(ChannelHandlerContext ctx, MQMessageOfESM27 t) {
//		SensorRealtimeDataEntity sensorDatas = ((JSONObject)t.getAwsPostdata()).toJavaObject(SensorRealtimeDataEntity.class);
//		GasAlgorithmManager.setGasDispersionParams(entity);sensorDatas);
		return null;
	}
	
}